package string;

public class StringDemo {
    public static void main(String[] args) {
        String a1="hello";
        String a2="hel"+"lo";
        String a3="hell";
        String a4=a3+"o";

//        System.out.println(String.class.getName()+"@"+Integer.toHexString(System.identityHashCode(a1)));
//        System.out.println(String.class.getName()+"@"+Integer.toHexString(System.identityHashCode(a2)));
//        System.out.println(String.class.getName()+"@"+Integer.toHexString(System.identityHashCode(a4)));

//        System.out.println(a1.equals(a2));
//        System.out.println(a1.equals(a4));//比较内容是否相同
//        System.out.println(a1==a2);//比较地址是否相同
        System.out.println(a1.length());


    }
}
